package com.xsy.config;

import org.springframework.context.annotation.Configuration;

/**
 * 项目名:    xinguan-parent
 * 类名称:      RedisConfig
 * 创建人:     xsy
 * 类描述:
 * 创建时间:    2021/9/9 14:32
 * Version:    1.0
 */
@Configuration
public class RedisConfig {
   /* //覆盖默认的自动配置
    @Bean
    public RedisTemplate<Object, Object> redisTemplate(
            RedisConnectionFactory redisConnectionFactory) throws UnknownHostException {
        RedisTemplate<Object, Object> template = new RedisTemplate<>();
        template.setConnectionFactory(redisConnectionFactory);
        //修改默认的序列化规则
        //1.创建序列化规则对象
        Jackson2JsonRedisSerializer jackson2JsonRedisSerializer=new Jackson2JsonRedisSerializer(Object.class);
        //2.更改默认的序列化规则
        template.setDefaultSerializer(jackson2JsonRedisSerializer);
        return template;
    }*/
}
